« first day (2272 days earlier)      last day (2902 days later) » 

20:00
@LeviMorrison err, wait
NOOOOOOOOOOOOOOOOO!!!!!!!!!!!!!!!!!!! @LeviMorrison!!!!!!!!!!!!!!! DON'T PUSH THAT BUTTON#@!#@!#@!#@!#@!#@!#@!
Wes
Wes
@JoeWatkins did you check if you got artifacts with the second picture ive sent to you?
@LeviMorrison I'm a bit confused right now because I only get stats on a debug build
Ah, will rebuild with debug enabled.
whew... I was worried that @LeviMorrison did press that button.
then you would have had that on your shoulders for the rest of your life, @NikiC
20:03
@LeviMorrison But I don't think I have any code to enforce that, so this might be something related to stderr being closed during shutdown. I've had issues with that in the past
> bin/php -dzend_extension=opcache.so -dopcache.enable_cli=1 -dopcache.optimization_level=-1 -dopcache.opt_statistics=1 perf3.php
I have no output at all there, though I'm not sure it should trigger in this case. Should I see some info whether anything was actually inlined?
@LeviMorrison yes
no output even with debug build?
Correct.
hm...
$ ~/opt/php/nikic/bin/php --ini
Configuration File (php.ini) Path: /home/levijm/opt/php/nikic/lib
$ cat ~/opt/php/nikic/lib/php.ini
date.timezone = America/Denver
opcache.enable_cli = 1

extension_dir = /home/levijm/opt/php/nikic/lib/php/extensions/debug-zts-20160303
20:09
just to sanity check, try to sapi/cli/php -dzend_extension=`pwd`/modules/opcache.so from within the build dir? I don't trust relative paths in extension loading
$ sapi/cli/php -dzend_extension=`pwd`/modules/opcache.so ~/Project/Ardent/perf3.php
^ that executed cleanly.
$ sapi/cli/php -dzend_extension=`pwd`/modules/opcache.so -dopcache.enable_cli=1 -dopcache.optimization_level=-1 -dopcache.opt_statistics=1 ~/Project/Ardent/perf3.php
^ That gave the same output.
(nothing on stderr)
Wes
Wes
@PeeHaa found the best series of "[insert car manufacturer] typical driver" videos. here's audi youtube.com/watch?v=N221CERFQag :D
Saw the thing already on your twitter :-) Watching
@LeviMorrison meh, no idea
20:18
@NikiC Does your fork put any info into opcache_get_status()?
@LeviMorrison nope
Only way to get it is via stderr?
probably should change it to write to something other than stderr
Where does it write to stderr? I can probably patch it locally.
@LeviMorrison ext/opcache/Optimizer/statistics.c. Though probably those stats aren't what you're looking for anyway. You probably want something more granular
20:23
@Wes does it apply to Opel too?
or that one doesn't really count as "car"
@NikiC Hmm... maybe I have the wrong repo; I do not have that file.
@LeviMorrison err, which branch are you on?
Wes
Wes
:P opel drivers are too vanilla maybe
@NikiC Doh, found it as you did ^_^
Rebuilding now.
@LeviMorrison ha :P
20:32
@NikiC Rebuilt; no stats.
Trying again with debug version...
:D
That worked \o/ time to look through the output
inlining_funcs             :     29
inlining_instrs            :    577   (17.66% instrs)
inlining_arg_assigns       :     17
\o/
It's like 2x slower than my mainline PHP because that's not a debug build (^_^)
@NikiC How confident are you that the inlining works when it's not a debug build? :D
@LeviMorrison it should work ... ^^
Yeah but... if you can't get the report...
would vld show the before or the after?
20:45
@pmmaga yeah
or phpdbp -p
@NikiC Ha; your branch is 2x slower. It's probably because it is the CLI and doesn't actually get to use the cache ^_^
@LeviMorrison yeah, if you count in compile time it can easily be slower for single run
or maybe it's genuinely slower, dunno :P
:D
@NikiC At present I'm also loading up an entire phar so...
How do I see the opcodes of a file other than the one that I directly executed?
levijm@honeywine:~/Project/Ardent$ ~/opt/php/nikic/bin/phpdbg -p Ardent/EnumerableTrait.php
function name: (null)
L1-97 {main}() /home/levijm/Project/Ardent/Ardent/EnumerableTrait.php - 0x7f7bc45504e0 + 1 ops
 L97   #0     RETURN                  1
[Script ended normally]
levijm@honeywine:~/Project/Ardent$ phpdbg -p Ardent/EnumerableTrait.php
function name: (null)
L1-95 {main}() /home/levijm/Project/Ardent/Ardent/EnumerableTrait.php - 0x7f32f8888180 + 4 ops
 L3    #0     NOP
 L6    #1     EXT_STMT
 L6    #2     NOP
 L95   #3     RETURN                  1
[Script ended normally]
@LeviMorrison EXT_STMT ... you're doing something wrong
There's obviously a difference if I just look at that file, which is just a trait definition.
20:58
@LeviMorrison I wondered that myself, I don't think phpdbg supports that :(
Probably only via the command line interface
4
Q: With declare(strict_types=1); PHP v7.0+ core functions does not honor strict typehinting

Zsolt OroszlányI've came across a really interesting bug in PHP 7.0.11 where declare(strict_types=1); enabled does not make the array_map() nor array_walk() aware of strict typehinting. I read somewhere that by enabling strict types PHP also uses strict typehinting in core functions, but this is not the case. L...

Any ERD expert here?
need some help
@NikiC phpdbg only should add EXT_STMT if -e is passed
You guys might want to check that out. Looks like it's a bug with array_map 3v4l.org/A8MJT
@NikiC Well... I guess I'll cat some files together and try to peek at it ^_^
21:00
@Machavity This is a known issue.
@Machavity It's a feature, not a bug
@tpunt Is there a bug report? Couldn't find one
there is no bug only feature
@Machavity internal PHP functions are weak types
21:01
@Machavity I don't think there is a bug report. Any call to a user function from internals is done weakly.
@bwoebi Ah
@Machavity It's a design issue, not a bug (because callbacks are generally called with the strict_types mode of the caller)
"Each student is assigned to 1 school and each teacher works for 1 school only"
Have i done it correctly?
or do i need to opposite the symbols?
Anybody? :/
@ZahidSaeed Looks correct to me. Not sure why you have 2 relationships between teachers and teachers_subjects though
I tell u
Next Statement:
"Each teacher teaches more than 1 subject but a subject may be taught by more than 1 teacher"
How will do it? :/
@tpunt Have i done it correct?. I'm not sure
21:06
@NikiC Is it possible to modify the oplines during runtime? For example, I'm fast-forwarding the opline, to skip execution of subsequent opcodes in each stack frame, but it doesn't seem to have any effect.
@ZahidSaeed that seems to be defined in teacher_subjects table
That's a Many to Many relationship right?
Have i put the correct symbols?
Please check the 2 lines to represent many to many relationship
Do i need both of them? or 1 will work too?
though, as a personal point of preference, I try to use same name for foreign keys as their referenced primary keys
21:08
@ZahidSaeed The many-to-many relationship is already resolved by having the teachers_subjects table - you don't need two relationships between teachers and teachers_subjects
@ZahidSaeed there should be only a single line
as for few other notes: the gender should be a number
type of subject also
@tereško Hey, my gender is not a number, you sexist.
qualification should be TEXT
21:10
I was thinking the same..
Thank you so much guys :)
@ZahidSaeed btw, there is one relation missing
@ZahidSaeed FYI, if you delete the lower identifying relationship (solid line one) between teachers and teachers_subjects, be sure to make the upper dashed relationship identifying (a solid line)
you have a managing_teacher_id
it should reference the teachers table
Yes I know @tereško
@bwoebi It's hard to believe it's been 2 years since then. Wow
21:13
Is it ok now @tereško I removed one line
there is one line missing
@ZahidSaeed You need to reverse the relationship between teachers and teachers_subjects
And between teachers_subjects and subjects
@tpunt are you talking about lines or table columns?
@tereško The lines
@tpunt Can i ask why do i need to reverse the line? Right now isn't it saying that many teachers can teach 1 subject?
21:17
because subject_id is the foreign key
@ZahidSaeed Your teachers_subjects is your resolution table for the many-to-many relationship. One teacher will have many subjects, and one subject will have many subject_teachers.
Am I still doing wrong?
@ZahidSaeed You still need to reverse the relationship between teachers_subjects and subjects. Also, the relationship between subjects and teachers_subjects should be an identifying relationship
@ZahidSaeed each scool can only have one managing teacher
21:21
can i send the model ? :/
@ZahidSaeed You will also need to use either a new surrogate key for teachers_subjects, or use a composite key of the two surrogate keys from the joining tables (teacher_id and id)
I don't understand what i'm doing wrong
@ZahidSaeed Presuming this is coursework, then you should learn about this stuff and do it yourself.
I'm trying
@Machavity uh, one year since 7.0 … well two years ago the big debates were
21:26
@bwoebi That's what I meant. Feb 18, 2015
@tpunt Now? :/
@ZahidSaeed Why do you have two relationships between schools and teachers now?
@tpunt Because 1 teacher will managing school
@ZahidSaeed That's not how to do this...
and it also says that the database should keep track of his/her managing date start/end date
Do i need to create another table for that?
21:33
@ZahidSaeed Is the primary key in teachers_subjects a composite key of both primary keys of joining tables also? If not, then it should be. And if it is, then you need to make both relationships identifying (solid, not dashed)
@ZahidSaeed The best way to learn would be to just give it a go and see whether it looks sensical or not, rather than simply asking for what needs to done
This is the first time i'm making an ERD
but i have to submit it tomorrow :/
Wes
Wes
@PeeHaa i'm not sure whether i should use data providers now, as i'd mostly have data providers with a single test only. maybe it's a good idea do that regardless..
21:52
@Wes I only use them when I have lots of mutation to check
@Wes I dislike the fact I have to look for stuff instead of just having it in my test
Wes
Wes
yeah that makes sense
i don't know what i'm doing though. tested wrong for years
@Wes You should try TDD (and no I am not one of those fanatics)
Wes
Wes
how often do you access private stuff? do you often use mocks?
@PeeHaa ironically i did read a lot about tdd and that mainly led me doing everything wrong :B i suppose i just read the wrong stuff...
@Wes Directly in my tests? never
The private parts that is
we all like private parts, don't we?
22:01
Only if it's @rdlowrey's
@JoeWatkins fyi: rethinkdb.com/blog/making-coroutines-fast - one essentially only needs to backup rsp[0] (the return address) and rsp[1] (the stack pointer) and restore the rsp from the other context and push the return address onto the stack, then ret and be done.
(that's just extended information we can use to make it even faster on a few target archs)
Wes
Wes
@PeeHaa testing through the public api might hide problems, no? while idk, accessing a private field and checking it's actually what it's expected it to be is very straightforward and unambiguous
I don't care about the private stuff, because I know when I throw a beer, throw 0 beers, throw 999999999 beers, throw a lizard, throw -1 beers in it the outcome is what I expect it to be
That way I know the private stuff works fine
generally speaking most ppl's private stuff works just fine
Wes
Wes
you mean empty beer bottles? :B
22:15
github.com/blog/2300-visualize-your-project-s-community < First: Yay! Then: Grumble, only Ruby :-(
Anonymous
@PeeHaa HEY
Sorry too late to edit. Was in a moment of awe
Wes
Wes
lol
Could someone help with this? Thanks I appreciate it.
http://stackoverflow.com/questions/41474141/laravel-put-all-records-together
@Ashkru have you tried turning it off and back on?
22:20
@JayIsTooCommon (he's actually not sorry)
@rabbitguy Tried turning what off and back on?
whats it?
oh, you know... the thing?
and that thing would be?
22:23
you know... the thing with that stuff on it... you know... that guy you know through that other guy was talking about how his friend was talking about it the other day
@tpunt Can you please check it one more time?
Can anyone please check the ERD?
Is it ok now?
Wes
Wes
user image
3
lol
Anonymous
@bwoebi don't say that :(
22:39
You know nothing @bwoebi
@PeeHaa And yet more than you
(i.e. your knowledge is negative)
@JayIsTooCommon he is doing it again ^
@bwoebi If anyone knows it would be you: using phpdbg can I dump the opcodes of a file other than the one I'm directly running?
22:45
@LeviMorrison yes, during phpdbg execution, there's the print command
Reminder set.
@bwoebi So interactively? Dang, I actually have to learn phpdbg now...
@LeviMorrison yeah, well, it needs to have that file loaded so that you can dump the ops
Mind if I ping you with questions as I fiddle with it?
22:46
@LeviMorrison no problem
@kelunik well, what's the trace of the typeerror?
@LeviMorrison just fyi ... urm ... I wrote large parts of phpdbg :)
prompt> break [method] \Ardent\Collection\ArrayCollection::reduce
[The command "break" expected condition and got method at parameter 2]
@JoeWatkins just fyi … urm … your last bigger contribution is quite old
22:49
@bwoebi it hasn't changed that much ...
@LeviMorrison eih, without the [method] - that's the placeholder
@bwoebi Don't know. Probably 4.8 that doesn't have PHP 7 support. Fixed requirements.
Bah, pressing "up" doesn't work. I assume that's because I didn't build with readline?
@kelunik that's causing the display … but what caused the TypeError in the first place?
@LeviMorrison Right.
22:51
@LeviMorrison yup
@JoeWatkins true :-)
@bwoebi Dunno.
@kelunik then run it anew with fixed requirements…
@bwoebi ?
@kelunik I mean with phpunit 5
@bwoebi I know it's your thing now (and like that) ... but can answer questions about it is all I was saying ... wasn't meant to come across as a dick head :)
22:54
@JoeWatkins (I don't like that TBH … I wished more people were involved :s)
I do work on it a little ... tbh I have no clue how we managed to write that in the week it took us to write it, it's very hard to find the time I need now to do interesting/useful stuff with it ...
if there was a bunch of people able to work on it, it would have existed before we wrote it ... there just aren't people able ... even if they were willing ...
Okay, I've got it built with readline support, have set a breakpoint somewhere and have given the run command.
How do I print the opcodes of some other unit?
@LeviMorrison I don't know by heart, check help print out
@NikiC So it shows the before or after..?
23:00
@kelunik well, your turn to look at that
Erm... it didn't like me:
$ ~/opt/php/nikic/bin/phpdbg -dopcache.optimization_level=-1 -dopcache.opt_statistics=1 -eperf.php
No opcodes could be compiled | No file specified or compilation failed?
@LeviMorrison what's -e here?
remove this -e
-e enables EXT_* opcodes and doesn't expect an argument
Does phpdbg support history if I install it?
Well... I've established one of the following things, I just don't know which one:
1) phpdbg doesn't print the optimized opcodes on NikiC's branch
2) My code wasn't actually inlined
23:06
it will print the opcodes as they are in memory, it does not do any recompile magic
I'm not sure how nikis branch is working though ...
(it will print what is going to be executed though, so that shouldn't matter)
I'm guessing it may have to do with this being a trait.
@LeviMorrison opcache is enabled in ini, right?
@bwoebi I got passed that particular issue ^_^
@LeviMorrison I doubt it, they are just normal class entries
Okay, I just ruled out 1).
This means that the code I was testing earlier was not inlined.
On 7.0:
L20-22 Foo::get() /home/levijm/Project/Ardent/perf3.php - 0x7f114cc5d780 + 9 ops
 L20   #0     EXT_NOP
 L21   #1     EXT_STMT
 L21   #2     INIT_METHOD_CALL                             "getInner"
 L21   #3     EXT_FCALL_BEGIN
 L21   #4     DO_FCALL                                                          @0
 L21   #5     EXT_FCALL_END
 L21   #6     RETURN                  @0
 L22   #7     EXT_STMT
 L22   #8     RETURN                  null
On NikiC's branch:
L20-22 Foo::get() /home/levijm/Project/Ardent/perf3.php - 0x7f4860627100 + 3 ops
 L21   #0     ENSURE_HAVE_THIS
 L16   #1     FETCH_OBJ_R_FIXED       THIS                 "inner"              @0
 L21   #2     RETURN                  @0
23:11
eih, can you run phpdbg without -e ?
yeah you don't need extended opcodes ...
So yay, it can inline and yay phpdbg reports those opcodes.
also @NikiC what's the plan with this inlining branch, I like very much ?
@bwoebi I did.
have you got something strange like xdebug loaded ?
others may also generate extended info ... xdebug is normally the culprit ...
23:14
Hmm... I don't think so. Why?
@LeviMorrison because unless you passed -e it shouldn't include extended opcodes by default in phpdbg
unless some other ext is forcing them to be generated, I think ?
yep
Ah, I see. Will investigate.
so xdbg, maybe a profiler of some sort ... that sort of thing is using them ...
23:16
Ah, it does have to do with it being a trait.
what is "it" ?
phpdbg doesn't care about difference between class and trait when printing opcodes ...
@JoeWatkins I mean it wasn't inlined.
extended ops should only ever be generated when CG(compiler_options) contains ZEND_COMPILE_EXTENDED_INFO flag
@LeviMorrison Ah, sure. within classes using traits the private methods can be overwritten when being bound… thus you cannot inline there
The presence of the trait is enough to disable the optimization.
23:19
you could only inline after binding
I know how to fix it
burn the trait, actually burn traits as a thing ...
@bwoebi Well, that I can understand. But using an empty trait will disable it.
@LeviMorrison As far as I understand, he's checking for it in github.com/nikic/php-src/blob/opt/ext/opcache/Optimizer/…
Anonymous
@PeeHaa just ignore them :( they're just jealous
Anonymous
Night all o/
23:24
Yeah, it's more work to do but the presence of the trait shouldn't disable all inlining; just for methods involved somehow from the trait.
nn @Jay
I'm not sure we keep any of that info around.
@LeviMorrison yeah, sure you can refine that, but for now he's a bit overzealous. Better optimize not enough than too much
@JoeWatkins I use traits as they exist in other languages: concrete functions only. No static methods, no properties, no constants.
@LeviMorrison in other languages, they are good ...
scratch that ... obviously not ...
traits may be added after all opcache optimizations ...
23:28
Maybe... if the scope of the prototype of the function doesn't match the function's scope..? bah, need to get into gdb...
I don't think that's quite right but it is closer.
methods that came from traits have zce's to the trait, I think.
Been a while since I dug into this core; it's crazy how fast that knowledge leaves me...
they should eventually have the correct class, after binding ... but when optimizations are run they may not be bound
(because that happens at runtime)
Well... instead of trying to fix it for now I'm going to see what else I can get it to optimize ^_^
@JoeWatkins I wished we could run (without opcache) an extra pass after binding
I was just thinking that exact thing, but the problem is once it's stored in shm, it cannot be modified
as said - without opcache - so no shm.
23:34
yeah .. I dunno what that would mean ... if opcache were actually a part of zend maybe ...
but still, I don't know how it would work ... but it seems that is what we want ...
@JoeWatkins s/opcache/Optimizer/
hmm
yeah that's maybe a way
I'll probably bother Dmitry about it once he's back from vacation
yeah, that can work ... someone should try to split them
good
@DaveRandom If NameServer is empty and DhcpNameServer doesn't exist, where do I have to look then? ci.appveyor.com/project/kelunik/dns/build/11/job/…
23:40
/me sleeps, nn all
@LeviMorrison at that point we have no info about which traits the class uses. traits are always late-bound
Trait's cannot override class methods, correct?
They can override a parent method.
True, but won't matter for the case I'm thinking of.
if from and into have the same scope and the ZCE is not a trait, and the correct one is a private method on the ZCE...
@LeviMorrison looking at the code it only disallows it if you're inlining into a trait
not if the class uses a trait
are you sure that's the problem?
23:44
@NikiC Yes.
@Trowski I don't think so. Weak typing makes sense for PHP because it's a web language, so most input is strings. Also, because integer/float conversions are annoying, and because truthiness and falsiness is useful.
Let me get you a file to see for yourself.
btw, @Jimbo, how far did you get with making that PC build?
I remember your monitor turned out to be shit and you returned it, but that's it
@JoeWatkins You didn't merge the copyright year update upwards grumble grumble grumble
@NikiC I thought I was sure but now I am less sure; need to go through my history.
@NikiC Any ideas about running Optimizer after late binding? Seem impossible, hard, or just needs time?
23:51
@LeviMorrison late binding = runtime binding
so impossible
at least with opcache that is
In this particular case a trait is really the best tool for the job :/
@LeviMorrison That's what they always say...
oh god what did you do
public on a separate line :((((
It logically implements Enumerable.
@NikiC I've been putting code on slides a lot lately; public + space is 7 characters man!
23:53
@LeviMorrison yeah, can't inline here because build() might be overwritten. At least not without speculation
@NikiC Which I totally understand.
But a trait really is the best tool if you are going to do something like this. Next best is AbstractEnumerable.
But if I get a lot of perf improvement maybe I'll take the #2 design tool.
heh, no point optimizing for potential future inlining now...
@NikiC In your mind what keeps this from being merged?
Everything I've peeked at thus far seems sane.
For inlining in particular I'd be concerned about backtraces
It's not a transparent optimization, at least without better debug metadata
I mean... that's new for the PHP crowd but... yeah, I'm fine with that ^_^
I'm pretty used to <optimized optimized out> and unhelpful frames in the trace ^_^
23:58
@Andrea That's like saying everything should use weak types, because file contents are usually strings and most applications read files.
I'll compare this toy to another toy to see the perf difference.
@kelunik they do?
and file contents are often binary

« first day (2272 days earlier)      last day (2902 days later) »