Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
General
»
Massive performance boost after unknown event
Print
Pages: [
1
]
Author
Topic: Massive performance boost after unknown event (Read 2428 times)
0 Members and 1 Guest are viewing this topic.
TheEvent
Guest
Massive performance boost after unknown event
«
on:
December 02, 2012, 08:09:48 am »
Post below
«
Last Edit: December 06, 2012, 10:30:13 am by TheEvent
»
Logged
TheEvent
Guest
Re: Massive performance boost after unknown event
«
Reply #1 on:
December 04, 2012, 07:44:56 am »
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/Graphics/VertexArray.hpp>
#include <SFML/Graphics/Texture.hpp>
#include <SFML/System/Clock.hpp>
#include <SFML/Window/Event.hpp>
int
main
(
)
{
sf
::
Vector2i
s
(
640
,
360
)
;
sf
::
RenderWindow
window
(
sf
::
VideoMode
(
s.
x
, s.
y
)
,
"TheEvent"
)
;
sf
::
VertexArray
graph
;
graph.
setPrimitiveType
(
sf
::
LinesStrip
)
;
for
(
int
x
=
0
;
x
<
s.
x
;
++
x
)
graph.
append
(
sf
::
Vertex
(
)
)
;
sf
::
Texture
texture
;
texture.
create
(
16
,
16
)
;
sf
::
Clock
clock
;
int
frame
=
0
;
while
(
true
)
{
sf
::
Event
e
;
while
(
window.
pollEvent
(
e
)
)
;
window.
clear
(
)
;
++
frame
;
clock
.
restart
(
)
;
for
(
int
i
=
0
;
i
<
s.
x
*
s.
y
/
256
;
++
i
)
{
sf
::
Uint8
buffer
[
1024
]
;
for
(
int
i
=
0
;
i
<
1024
;
i
++
)
buffer
[
i
]
=
rand
(
)
%
256
;
texture.
update
(
buffer
)
;
// <<----randomly super slow
}
graph
[
frame
%
s.
x
]
.
position
=
sf
::
Vector2f
(
frame
%
s.
x
,
s.
y
-
s.
y
*
clock
.
getElapsedTime
(
)
.
asMicroseconds
(
)
/
33333
)
;
window.
draw
(
graph
)
;
window.
display
(
)
;
}
return
0
;
}
«
Last Edit: December 06, 2012, 10:30:55 am by TheEvent
»
Logged
Laurent
Administrator
Hero Member
Posts: 32498
Re: Massive performance boost after unknown event
«
Reply #2 on:
December 04, 2012, 07:59:44 am »
Thanks a lot for your tests. Unfortunately, I don't see what could be causing this in Texture::update. You'll have to investigate further if you want to find out what happens
Logged
Laurent Gomila - SFML developer
Laurent
Administrator
Hero Member
Posts: 32498
Re: Massive performance boost after unknown event
«
Reply #3 on:
December 04, 2012, 08:30:42 pm »
Have you tried to remove all the glGet calls? You can safely remove glGetError() and all glGet related to the preservation of texture/shader binding.
Logged
Laurent Gomila - SFML developer
Laurent
Administrator
Hero Member
Posts: 32498
Re: Massive performance boost after unknown event
«
Reply #4 on:
December 05, 2012, 08:07:29 am »
Great. Could you create a task in the tracker which summarizes what you found, with a link to this forum thread? So that it doesn't get forgotten, and hopefully "fixed" one day
Logged
Laurent Gomila - SFML developer
eXpl0it3r
SFML Team
Hero Member
Posts: 11030
Re: Massive performance boost after unknown event
«
Reply #5 on:
December 05, 2012, 08:30:23 pm »
Laurent meant that you should make a new issue on the
issue tracker
.
I guess the pull request is also a nice way to share the possible changes, but an issue might work additionally too.
Logged
Official FAQ:
https://www.sfml-dev.org/faq.php
Official Discord Server:
https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog:
https://duerrenberger.dev/blog/
Laurent
Administrator
Hero Member
Posts: 32498
Re: Massive performance boost after unknown event
«
Reply #6 on:
December 05, 2012, 08:46:25 pm »
Since I can't merge your code (see my comments in your pull request), yes, you should rather create a new task.
Logged
Laurent Gomila - SFML developer
Print
Pages: [
1
]
SFML community forums
»
Help
»
General
»
Massive performance boost after unknown event